package com.changgou.search;

import org.elasticsearch.search.aggregations.bucket.terms.StringTerms;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories;

/**
 * @Author: wzw
 * @Date: 2020/12/13 18:07
 * @version: 1.8
 */
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})//启动类注解:排除数据库类
@EnableEurekaClient//开启注册中心客户端
@EnableFeignClients(basePackages = "com.changgou.goods.feign")//开启RPC远程调用客户端
@EnableElasticsearchRepositories(basePackages = "com.changgou.search.dao")//开启es扫描器
public class SearchApplication {
    public static void main(String[] args) {
        /**
         * Springboot整合Elasticsearch 在项目启动前设置一下的属性，防止报错
         * 解决netty冲突后初始化client时还会抛出异常
         * availableProcessors is already set to [12], rejecting [12]
         * 程序的其他地方使用了Netty影响在实例化传输客户端之前初始化处理器的数量
         ***/
//        System.setProperty("es.set.netty.runtime.available.processors", "false");
        //run一下
        SpringApplication.run(SearchApplication.class, args);

    }

}
